package cc.verywell.pureblock.msg.nfs.idx.extraUpload;

import java.io.IOException;

import cc.verywell.pureblock.func.node.KeyShell;
import cc.verywell.pureblock.msg.nfs.hd.NoEnoughSpaceException;
import cc.verywell.pureblock.msg.nfs.idx.NfsidxStructure;

/**
* 
* Copyright © 2019 TanYaqiu. All rights reserved.
* @author TanYaqiu 
* @address flat 601
* @date 2019年10月2日 下午5:54:59
*/
public interface UploadNeed {
	byte addIndex(KeyShell key, NfsidxStructure idx);//需要在此函数内异步推送newStored(key)
	byte replaceIndex(KeyShell key, NfsidxStructure oldidx, NfsidxStructure newidx);
	byte removeIndex(KeyShell key, NfsidxStructure idx);
	
	void removeHold(Object lock);
	NfsidxStructure putAndHoldInternal(Object hold,KeyShell key,byte[] value) throws IOException,NoEnoughSpaceException;//需要在此函数内异步推送newStored(key)
	NfsidxStructure tryHoldInternal(Object hold,KeyShell key,byte[] value);//下载时顺便做种用的，不用推送newStored(key)并且不需要检查value
}
